﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.Xml;
using System.Text;
using System.Threading.Tasks;

namespace AnnealingModel.Demo.Common.Function
{
    [DisplayText(FunctionType.UnaryFunction1, "y=xsin(10πx)+2")]
    internal class UnaryFunction1 : FuntionBase
    {
        public UnaryFunction1()
        {
            this.Range = (-1, 2);
            this.Solve = SolveType.Max;
            this.Accuracy = 6;
        }
        public override double Func(params double[] xs)
        {
            // y=xsin(10πx)+2
            double x = xs[0];
            return x * Math.Sin(10 * Math.PI * x) + 2d;
        }
    }
}
